﻿using Quartz;
/*********************************************************************
 * CopyRight (c) 2009-2014 HangJing Teconology. All Rights Reserved.
 * FileName : 
 * Function : 
 * Created by jijunjian at 2014-11-14 15:24:53.
 * E-Mail   : jijunjian@ihangjing.com
*********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hangjing.DBUtility;
using System.Data;
using Hangjing.SQLServerDAL;

namespace Hangjing.Job
{
    /// <summary>
    /// 每月一号，定时生成上月工资记录
    /// </summary>
    public class autoBuildSalaryData : Quartz.IJob
    {
        private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        /// <summary>
        /// 执行
        /// </summary>
        /// <param name="context"></param>
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                logger.Info("autoBuildSalaryData任务开始运行");
                new DeliverSalaryLog().payoff(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-1"), "系统");
                logger.Info("autoBuildSalaryData任务运行结束");
            }
            catch (Exception ex)
            {
                logger.Error("autoBuildSalaryData任务运行运行异常：" + ex);
            }

        }
    }
}
